"""HelloWorld URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.conf.urls.static import static
from django.conf import settings

from app import views

"""
route: 字符串，表示 URL 规则，与之匹配的 URL 会执行对应的第二个参数 view。

view: 用于执行与正则表达式匹配的 URL 请求。

kwargs: 视图使用的字典类型的参数。

name: 用来反向获取 URL,reverse(name)得到name代表的url。
"""
urlpatterns = [
    # path('admin/', admin.site.urls),#路径是字符串
    path('tcm-api/hello/',views.hello),#路径是正则或字符串
    #www.xxx.com/index/ ->函数
    path('index/',views.index),
    path('user/list/',views.user_list),
    path('tpl/',views.tpl),
    path('news/',views.news),
    path('login/',views.login),
    path('tcm-api/info/node/',views.nodeInfo,name="nodeInfo"),
    path('tcm-api/info/nodeMessage/',views.nodeMessage,name="nodeMessage"),
    path('search_1/',views.search_1,name="search_1"),
    path('tcm-api/search/',views.search,name="search"),
    path('test/axios/',views.test_axios,name="test_axios"),
    path('test/get/',views.test_get,name="test_get"),
    path('tcm-api/info/nodes_count/',views.nodes_count,name="nodesCount"),
    path('tcm-api/download/node/',views.downloadNode,name="downloadNode"),
    # path('download/relation',views.downloadRelation,name="downloadRelation")
    path('tcm-api/info/getRelationNodes/',views.getRelationNodes,name="relationNodes"),
    path('tcm-api/info/statistic/',views.getStats,name="statistic"),
    path('tcm-api/paper/getPaperText/',views.getPaperText,name="paperText"),
    path('tcm-api/paper/getEntityResult/',views.getEntityResult,name="entityResult"),
    path('tcm-api/paper/getRelationResult/',views.getRelationResult,name="relationResult")
]+static(settings.STATIC_URL,document_root=settings.STATIC_ROOT)#将默认的static映射到app/static



